import request from './../utils/request'
export default{
    login(params){
        return request({
            method:'post',
            url:'/sys/login',
            data:params
        })
    },
    menuTree(){
        return request({
            method:'get',
            url:'/sys/module/menu/list',
            data:{}
        })
    },
    menuTreeForUser(userId){
        return request({
            method:'get',
            url:'/sys/module/menu/list/' + userId,
            data:{}
        })
    },
    menuAdd(params){
        return request({
            method:'post',
            url:'/sys/module/menu',
            data:params
        })
    },
    menuDel(id){
        return request({
            method:'delete',
            url:'/sys/module/menu/' + id,
            data:{}
        })
    },
    userList(params){
        return request({
            method:'get',
            url:'/sys/user/user/list',
            data:params
        })
    },
    userDel(params){
        return request({
            method:'delete',
            url:'/sys/user/del',
            data:params
        })
    },
    userAdd(params){
        return request({
            method:'post',
            url:'/sys/user/user',
            data:params
        })
    },
    roleList(params){
        return request({
            method:'get',
            url:'/sys/role/role/list',
            data:params
        })
    },
    roleAllList(){
        return request({
            method:'get',
            url:'/sys/role/getAll',
            data:{}
        })
    },
    roleDel(params){
        return request({
            method:'delete',
            url:'/sys/role',
            data:params
        })
    },
    roleAdd(params){
        return request({
            method:'post',
            url:'/sys/role',
            data:params
        })
    },
    roleAddPrem(params){
        return request({
            method:'post',
            url:'/sys/role/role/menu',
            data:params
        })
    },
    categoryTree(){
        return request({
            method:'get',
            url:'/goods/category/tree',
            data:{}
        })
    },
}